package com.ibeeking.found.open.api.feign;

import com.ibeeking.found.open.api.common.dto.ApiMemberInfoDTO;
import com.ibeeking.found.open.api.common.query.ApiMemberInfoQuery;
import com.ibeeking.found.open.api.common.query.MemberIdCodeQuery;
import com.ibeeking.found.open.api.common.query.QrCodeQuery;
import com.ibeeking.found.open.api.feign.fallback.MemberFeignFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


/**
 * @Author ibeeking
 */
@FeignClient(name = "mall-member-c-server", path = "/c", contextId = "openMemberFeignClient", fallbackFactory = MemberFeignFallbackFactory.class, decode404 = true)
public interface MemberFeignClient {

    /**
     * 根据会员码解析会员id 并校验传入会员id和解析出的是否一致
     *
     * @param query
     * @return
     */
    @PostMapping(value = "/member/feign/v1/queryAndCheckMemberIdByQrCode")
    ResponseResult<Long> queryAndCheckMemberIdByQrCode(@RequestBody MemberIdCodeQuery query);

    /**
     * api 获取会员信息
     *
     * @param query
     * @return
     */
    @PostMapping(value = "/member/feign/v1/api/queryMemberInfo")
    ResponseResult<ApiMemberInfoDTO> apiQueryMemberInfo(@RequestBody ApiMemberInfoQuery query);

    /**
     * 会员码
     *
     * @param query
     * @return
     */
    @PostMapping(value = "/member/feign/v1/qrcode")
    feign.Response memberQrCode(@RequestBody QrCodeQuery query);
}
